<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 二、promise里的静态方法
      // 静态成员 ： 1.静态属性  2.静态方法
      let p = new Promise((reslove, reject) => {
        reslove("success");
      });
      // resolve是Promise的静态方法 实例对象p访问不到
      let res = Promise.resolve("success");
      console.log(res);

      class MyPromise {
        static resolve(val) {
          return new Promise((resolve) => {
            resolve(val);
          });
        }
        static reject(err) {
          return new Promise((resolve, reject) => {
            reject(err);
          });
        }
      }

      let res2 = MyPromise.resolve("success");
      console.log(res2);
    </script>
  </body>
</html>
